module RubyEmoji
  # The Parser to parse a string to an emoji string
  class Parser

    # Initialize it with the string you want to convert
    def initialize(string)
      @string = string
    end

    # Returns the converted string
    def parse
      parts = @string.split(" ")
      results = parts.map do |part|
        RubyEmoji::EMOJI_LIST[part] || part
      end
      results.join(" ")
    end
  end
end
